package com.faith.timefloating.adapter;

import android.content.Context;
import kankan.wheel.widget.adapters.AbstractWheelTextAdapter;

public abstract class AbstractInfinitiveWheelTextAdapter extends
		AbstractWheelTextAdapter {

	Context mContext;
	int mLoopValue;

	public static final int HALF_MAX_VALUE = Integer.MAX_VALUE / 2;
	public int MIDDLE;

	public AbstractInfinitiveWheelTextAdapter(Context context,
			int itemResource, int itemTextResource, int mLoopValue) {
		super(context, itemResource, itemTextResource);
		this.mContext = context;
		this.mLoopValue = mLoopValue;
		MIDDLE = HALF_MAX_VALUE - HALF_MAX_VALUE % mLoopValue;
	}

	public AbstractInfinitiveWheelTextAdapter(Context context, int mLoopValue) {
		super(context);
		this.mContext = context;
		this.mLoopValue = mLoopValue;
		MIDDLE = HALF_MAX_VALUE - HALF_MAX_VALUE % mLoopValue;
	}

	public int getDivFromMiddle(int postion) {
		return postion - MIDDLE;
	}
	
	public abstract int getVituarlPosFromRealPos(int position);

	@Override
	public int getItemsCount() {
		return Integer.MAX_VALUE;
	}
	
}
